package com.homework.phase1.module3;

import java.util.Scanner;

public class RunSystem  {

    public void run() {
        InfoManagement infoManagement = new InfoManagement();
        System.out.println("欢迎进入学生信息管理系统");

        Scanner sc = new Scanner(System.in);


        boolean flag = true;
        while (flag) {
            System.out.println("请输入以下任意功能指令：增加、修改、删除、查找、遍历、退出");
            String command = sc.next();
            switch (command) {

                case "增加":
                    infoManagement.addStudent();break;

                case "修改":
                    infoManagement.modifyStudent();break;

                case "删除":
                    infoManagement.removeStudent(); break;

                case "查找":
                    infoManagement.findStudent(); break;

                case "遍历":
                    System.out.println(infoManagement.allStudent()); break;

                case "退出":
                    flag = false;
                    System.out.println("谢谢使用，下次再见！");
                    break;
            }
        }
    }

}
